package com.cloudcc.cloudframe.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 子菜单
 * 
 * @author wangzhiqiang
 * @date 2015-7-28 下午5:35:27
 * 
 */
public class MenuTabModel implements Parcelable {

	public String id;
	public String url;
	public String tabStyle;
	public String tab_style;
	public String tabName;
	public String tab_name;
	public String imageId;
	public String objId;// 对象id

	@Override
	public boolean equals(Object o) {
		if (o == null)
			return false;
		if (this == o) {
			return true;
		}
		if (o instanceof MenuTabModel) {
			MenuTabModel other = (MenuTabModel) o;
			return (other.id).equals(this.id);
		}
		return false;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(id);
		dest.writeString(url);
		dest.writeString(tabStyle);
		dest.writeString(tab_style);
		dest.writeString(tabName);
		dest.writeString(tab_name);
		dest.writeString(imageId);
	}

	public static final Parcelable.Creator<MenuTabModel> CREATOR = new Creator<MenuTabModel>() {
		// 实现从source中创建出类的实例的功能
		@Override
		public MenuTabModel createFromParcel(Parcel source) {
			MenuTabModel parInfo = new MenuTabModel();
			parInfo.id = source.readString();
			parInfo.url = source.readString();
			parInfo.tabStyle = source.readString();
			parInfo.tab_style = source.readString();
			parInfo.tabName = source.readString();
			parInfo.tab_name = source.readString();
			parInfo.imageId = source.readString();
			return parInfo;
		}

		// 创建一个类型为T，长度为size的数组
		@Override
		public MenuTabModel[] newArray(int size) {
			return new MenuTabModel[size];
		}
	};
}
